From 595f163337b6aff8f97cc77e362e8c5868463c21 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Wed, 18 Sep 2013 05:17:49 +0000 Subject: [PATCH] Warning fixes from Conrad. --- gpsbabel/cet/ansi_x3_4_1968.h | 2 +- gpsbabel/cet/iso_8859_1.h | 2 +- gpsbabel/cet_util.cc | 16 ++++++++++------ gpsbabel/csv_util.cc | 3 ++- gpsbabel/garmin_fs.cc | 2 ++ gpsbabel/gbfile.cc | 5 +++++ gpsbabel/gbser_posix.cc | 4 ++++ gpsbabel/jeeps/gpsmath.cc | 12 ++++++++---- 8 files changed, 33 insertions(+), 13 deletions(-) diff --git a/gpsbabel/cet/ansi_x3_4_1968.h b/gpsbabel/cet/ansi_x3_4_1968.h index 78574c0f0..0ad2b0b96 100644 --- a/gpsbabel/cet/ansi_x3_4_1968.h +++ b/gpsbabel/cet/ansi_x3_4_1968.h @@ -41,7 +41,7 @@ const int cet_ucs4_map_ansi_x3_4_1968[cet_ucs4_cnt_ansi_x3_4_1968] = {0}; #define cet_ucs4_to_ansi_x3_4_1968_ct 1 -const cet_ucs4_link_t cet_ucs4_to_ansi_x3_4_1968_links[cet_ucs4_to_ansi_x3_4_1968_ct] = {{0}}; +const cet_ucs4_link_t cet_ucs4_to_ansi_x3_4_1968_links[cet_ucs4_to_ansi_x3_4_1968_ct] = {{0, 0}}; // #define cet_ucs4_to_ansi_x3_4_1968_extra_ct 200 diff --git a/gpsbabel/cet/iso_8859_1.h b/gpsbabel/cet/iso_8859_1.h index 70b71664c..82a61855d 100644 --- a/gpsbabel/cet/iso_8859_1.h +++ b/gpsbabel/cet/iso_8859_1.h @@ -41,7 +41,7 @@ const int cet_ucs4_map_iso_8859_1[cet_ucs4_cnt_iso_8859_1] = {0}; #define cet_ucs4_to_iso_8859_1_ct 1 -const cet_ucs4_link_t cet_ucs4_to_iso_8859_1_links[cet_ucs4_to_iso_8859_1_ct] = {{0}}; +const cet_ucs4_link_t cet_ucs4_to_iso_8859_1_links[cet_ucs4_to_iso_8859_1_ct] = {{0, 0}}; /* #define cet_ucs4_to_iso_8859_1_extra_ct 0 diff --git a/gpsbabel/cet_util.cc b/gpsbabel/cet_util.cc index 2ea3d52d9..f6026af72 100644 --- a/gpsbabel/cet_util.cc +++ b/gpsbabel/cet_util.cc @@ -386,15 +386,16 @@ const char* cet_cs_utf8_alias[] = { cet_cs_vec_t cet_cs_vec_utf8 = { CET_CHARSET_UTF8, cet_cs_utf8_alias, - NULL, /* dec */ - NULL, /* enc */ - NULL, /* link */ + NULL, + NULL, + NULL, + 0, 0, + NULL, + 0, + NULL, 0, - NULL, /* extra */ - 0, /* extras */ NULL, - 0 }; void @@ -1044,6 +1045,7 @@ cet_convert_route_hdr(const route_head* route) static void cet_convert_route_tlr(const route_head* route) { + (void)route; } /* %%% cet_convert_strings (public) %%% @@ -1057,6 +1059,8 @@ cet_convert_strings(const cet_cs_vec_t* source, const cet_cs_vec_t* target, cons { char* cs_name_from, *cs_name_to; + (void)format; + converter = NULL; if ((source == NULL) || (source == &cet_cs_vec_utf8)) { diff --git a/gpsbabel/csv_util.cc b/gpsbabel/csv_util.cc index a09c577a0..62da6164f 100644 --- a/gpsbabel/csv_util.cc +++ b/gpsbabel/csv_util.cc @@ -936,7 +936,7 @@ static int writehms(char* buff, size_t bufsize, const char* format, time_t t, int gmt) { - static struct tm no_time = {0}; + static struct tm no_time = tm(); static struct tm* stmp = &no_time; if (gmt) { @@ -2195,6 +2195,7 @@ next: static void xcsv_noop(const route_head* wp) { + (void)wp; /* no-op */ } diff --git a/gpsbabel/garmin_fs.cc b/gpsbabel/garmin_fs.cc index 3717cdfb6..59fae1780 100644 --- a/gpsbabel/garmin_fs.cc +++ b/gpsbabel/garmin_fs.cc @@ -463,6 +463,8 @@ garmin_fs_garmin_before_write(const waypoint* wpt, GPS_PWay way, const int proto { garmin_fs_t* gmsd = GMSD_FIND(wpt); + (void)protoid; // unused for now. + if (gmsd == NULL) { return; } diff --git a/gpsbabel/gbfile.cc b/gpsbabel/gbfile.cc index 12fcd924c..58925f643 100644 --- a/gpsbabel/gbfile.cc +++ b/gpsbabel/gbfile.cc @@ -359,6 +359,8 @@ stdapi_error(gbfile* self) static gbfile* memapi_open(gbfile* self, const char* mode) { + (void)mode; + self->mempos = 0; self->memsz = 0; self->handle.mem = NULL; @@ -445,6 +447,7 @@ memapi_write(const void* buf, const gbsize_t size, const gbsize_t members, gbfil static int memapi_flush(gbfile* self) { + (void)self; return 0; } @@ -475,12 +478,14 @@ memapi_ungetc(const int c, gbfile* self) static void memapi_clearerr(gbfile* self) { + (void)self; return; } static int memapi_error(gbfile* self) { + (void)self; return 0; } diff --git a/gpsbabel/gbser_posix.cc b/gpsbabel/gbser_posix.cc index aaeb0ca57..ed9fcd6b7 100644 --- a/gpsbabel/gbser_posix.cc +++ b/gpsbabel/gbser_posix.cc @@ -325,11 +325,15 @@ int gbser__fill_buffer(void* handle, unsigned want, unsigned* ms) time_left = *ms - elapsed(&tv); if (FD_ISSET(h->fd, &rec)) { +#if 0 + // See below comment. + unsigned vmin = 0, vtime = 0; if (time_left >= 100) { vmin = want - h->inbuf_used; vtime = (unsigned) time_left / 100; } +#endif // The commented out call to set_rx_timeout here is totally // legal by POSIX standards but does result in a flurry of // of tcsetattrs that slightly tweak VMIN/VTIME while there diff --git a/gpsbabel/jeeps/gpsmath.cc b/gpsbabel/jeeps/gpsmath.cc index ecb34c74d..efb09c881 100644 --- a/gpsbabel/jeeps/gpsmath.cc +++ b/gpsbabel/jeeps/gpsmath.cc @@ -766,7 +766,6 @@ void GPS_Math_Cassini_LatLon_To_EN(double phi, double lambda, double* E, double E0, double N0, double a, double b) { double p2; - double po2; double a2; double b2; double e2; @@ -778,21 +777,25 @@ void GPS_Math_Cassini_LatLon_To_EN(double phi, double lambda, double* E, double c2; double c3; double om0; +#if 0 double A0; double A1; double A2; double A3; +#endif double j; double te4; double phi0s2; double phi0s4; double phi0s6; double lat; +#if 0 double x; double E1; double E2; double E3; double E4; +#endif double phis; double phic; @@ -820,7 +823,6 @@ void GPS_Math_Cassini_LatLon_To_EN(double phi, double lambda, double* E, p2 = (double)GPS_PI * (double)2.; - po2 = (double)GPS_PI / (double)2.; a2 = a*a; b2 = b*b; @@ -842,6 +844,8 @@ void GPS_Math_Cassini_LatLon_To_EN(double phi, double lambda, double* E, AM0 = a * (lat-phi0s2+phi0s4-phi0s6); om0 = (double)1.0 - e2; +#if 0 + // None of this is used -- is there a reason to keep it? x = pow(om0,(double)0.5); E1 = ((double)1.0 - x) / ((double)1.0 + x); E2 = E1*E1; @@ -851,6 +855,7 @@ void GPS_Math_Cassini_LatLon_To_EN(double phi, double lambda, double* E, A1 = (double)21.*E2/(double)16.-(double)55.*E4/(double)32.; A2 = (double)151.*E3/(double)96.; A3 = (double)1097.*E4/(double)512.; +#endif dlam = lambda - M0; @@ -2515,7 +2520,7 @@ void GPS_Math_UTM_EN_to_LatLon(int ReferenceEllipsoid, double eccPrimeSquared; double e1; double N1, T1, C1, R1, D, M; - double mu, phi1, phi1Rad; + double mu, phi1Rad; double x, y; a = GPS_Ellipse[ReferenceEllipsoid].a; @@ -2534,7 +2539,6 @@ void GPS_Math_UTM_EN_to_LatLon(int ReferenceEllipsoid, phi1Rad = mu+ (3*e1/2-27*e1*e1*e1/32)*sin(2*mu) + (21*e1*e1/16-55*e1*e1*e1*e1/32)*sin(4*mu) + (151*e1*e1*e1/96)*sin(6*mu); - phi1 = GPS_Math_Rad_To_Deg(phi1Rad); N1 = a/sqrt(1-eccSquared*sin(phi1Rad)*sin(phi1Rad)); T1 = tan(phi1Rad)*tan(phi1Rad); -- 2.30.2